package com.adam.mbt.service;

import com.adam.mbt.entity.User;
import com.adam.mbt.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> selectAllUser() {
        return userMapper.selectAllUser();
    }

    @Override
    public User selectByPrimaryKey(Integer userId) {
        return userMapper.selectByPrimaryKey(userId);
    }

    @Override
    public User findUserByIdAndUserName(Integer userId, String userName) {
        return userMapper.findUserByIdAndUserName(userId, userName);
    }

    @Override
    public List<User> getUserByMap(Map<String, Object> paramMap) {
        return userMapper.getUserByMap(paramMap);
    }

    @Override
    public List<User> getUserByBean(Integer userId, String userName) {
        User user = new User();
        user.setUserId(userId);
        user.setUserName(userName);
        return userMapper.getUserByBean(user);
    }


}
